package com.itheima.bos.service.base.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.itheima.bos.dao.base.ITakeTimeRepository;
import com.itheima.bos.domain.base.TakeTime;
import com.itheima.bos.service.base.ITakeTimeSerivce;
@Service
@Transactional
public class TakeTimeSerivceImpl implements ITakeTimeSerivce {

	//注入dao层
	@Autowired
	private ITakeTimeRepository takeTimeRepository;
	
	//添加收派时间
	@Override
	public void sava(TakeTime model) {
		takeTimeRepository.save(model);
	}

	@Override
	public Page<TakeTime> findPageData(Pageable pageable) {
		
		return takeTimeRepository.findAll(pageable);
	}
	//查询所有收派时间
	@Override
	public List<TakeTime> findAll() {
		
		return takeTimeRepository.findAll();
	}
}
